﻿#region

using System;
using CuongHanh.Context;

#endregion

namespace CuongHanh.Helpers
{
    public class PasswordHelper
    {
        private const string LoginPattern = "Pe45O65^&{0}Afd8D5h2a5kj6HF0jkq{1}jgsy94e6*";

        private const string ResetPasswordPattern = "Pe453E2R^&{0}Af%^&(U)d2a{1}5&^v%M0jkqU^{2}%I*(D4e6*";

        public static string GetPassword(string username,
                string password)
        {
            return string.Format(LoginPattern,
                    username,
                    password).GetMd5();
        }

        public static string GetResetKey(int id,
                string username)
        {
            return string.Format(ResetPasswordPattern,
                    id,
                    username,
                    DateTime.Now).GetMd5();
        }
    }
}
